<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        padding: 20px;
        width: 400px;
        text-align: center;
        /* border: 4px solid #fac; */
        margin: 100px;
        position: relative;
      }
      .box::after {
        content: "";
        position: absolute;
        left: -3px;
        top: -3px;
        right: -3px;
        bottom: -3px;
        border: 5px solid #cfa;
        clip-path: inset(0 96% 0 0);
        animation: clip-inset 2s linear infinite, hue-rotate 2s linear infinite;
      }
      @keyframes hue-rotate {
        to {
            filter: hue-rotate(360deg)
        }
      }
      @keyframes clip-inset {
        0%,
        100% {
          clip-path: inset(0 96% 0 0);
        }
        25% {
          clip-path: inset(0 0 96% 0);
        }
        50% {
          clip-path: inset(0 0 0 96%);
        }
        75% {
          clip-path: inset(96% 0 0 0);
        }
      }
    </style>
  </head>
  <body>
    <div class="box">css 裁剪 clip-path</div>
  </body>
</html>

